package com.czyxy.services;

import com.czyxy.utils.OperationType;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    public void validateUser(String username, String password, OperationType type) throws Exception {
        switch (type) {
            case UPLOAD:
                if(!username.equals("uploader")||!password.equals("up123456")){
                    throw new Exception("上传数据失败!用户或密码不正确!");
                }
                break;
            case TQUERY:
                if(!username.equals("tquery")||!password.equals("q123456")){
                    throw new Exception("查询数据失败!用户或密码不正确!");
                }
                break;
                default:break;
        }
    }
}
